package com.rw.engine.permission.anno;

import com.rw.engine.CommonLimit;
import com.rw.engine.permission.interceptor.DefaultPermissionFilterRule;
import com.rw.engine.permission.interceptor.PermissionFilterRule;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@CommonLimit
public @interface Permission {
    String[] value() default NO_PERMISSION;

    @AliasFor(annotation = CommonLimit.class, attribute = CommonLimit.FILTER_RULE)
    Class<? extends PermissionFilterRule>[] PermissionFilterRule() default DefaultPermissionFilterRule.class;

    String NO_PERMISSION = "";

}

